package kr.saeildamil.androidstudy_second.draw;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class BlurFilter extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new MyView(this));
	}
	
	public class MyView extends View{
		
		public MyView(Context context) {
			super(context);
		}
		
		@Override
		public void onDraw(Canvas canvas) {
			super.onDraw(canvas);
			canvas.drawColor(Color.LTGRAY);
			Paint paint= new Paint();
			paint.setAntiAlias(true);
			
			paint.setColor(Color.YELLOW);
			canvas.drawRect(10, 10, 100, 100, paint);
			
			paint.setColor(Color.GREEN);
			canvas.save();
			canvas.translate(200, 0);
			canvas.drawRect(10, 10, 100, 100, paint);
			
			paint.setColor(Color.BLUE);
			canvas.restore();
			canvas.translate(200, 200);
			canvas.drawRect(10, 10, 100, 100, paint);
			
			
			canvas.restore();
			canvas.translate(0, 400);
			canvas.drawRect(10, 10, 100, 100, paint);
			
			
			canvas.skew(-0.1f, 0);
			canvas.translate(120, 0);
			canvas.drawRect(10, 10, 100, 100, paint);
			
			canvas.skew(-0.1f, 0);
			canvas.translate(120, 0);
			canvas.drawRect(10, 10, 100, 100, paint);
			
			canvas.skew(-0.1f, 0);
			canvas.translate(120, 0);
			canvas.drawRect(10, 10, 100, 100, paint);
			
			canvas.restore();
			canvas.translate(0, 500);
			canvas.scale(0.5f, 0.5f);
			canvas.drawRect(10, 10, 100, 100, paint);
			
/*			paint.setColor(Color.GREEN);
			canvas.translate(200, 0);
			canvas.drawRect(10, 10, 100, 100, paint);
			
			
			paint.setColor(Color.BLUE);
			canvas.translate(0, 200);
			canvas.drawRect(10, 10, 100, 100, paint);*/
		}
		
	}
}
